import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router) //让vue使用vue-router插件

//路由懒加载 
//主要是为了解决  进入首页不用一次加载过多资源造成用时过长！！！
export default new Router({
  routes: [
    {path:"/",redirect:"/home"},
    {path:"/home",component:()=>import("@/views/Home")},
    {path:"/list",component:()=>import("@/views/List"),children:[
      //二级路由path不能加/
      {path:"",redirect:"guonei"},
      {name:"gn",path:"guonei",component:()=>import("@/views/Guonei")},  
      {name:"gj",path:"guoji",component:()=>import("@/views/Guoji")}
    ]},
    {path:"/mine",component:()=>import("@/views/Mine")},
    {path:"/detail/:orderId",component:()=>import("@/views/Detail")}
  ]
})